package com.muyu.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName: KafkaConfig
 * @Author: Zirun.Xin
 * @Date: 2025/4/27 上午9:26
 * @Version: 1.0
 * @Description: kafka配置
 */
@Configuration
public class KafkaConfig {

    /**
     * 创建一个名为topic.test的Topic并设置分区数为8，分区副本数为2
     * @return topic实例
     */
    @Bean
    public NewTopic initialTopic() {
        return new NewTopic("topic.test", 8, (short) 2);
    }
}
